package config;

import dao.JdbcUserDAO;
import dao.RedisUserDAO;
import dao.UserDao;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @BelongsProject: my-product
 * @BelongsPackage: config
 * @Author: wanglf
 * @CreateTime: 2023-06-20  11:29
 * @Description:
 * @Version: 1.0
 */
@Configuration
public class AppConfig2 {

    @DatabaseType("MYSQL")
    public UserDao jdbcUserDao(){
        return new JdbcUserDAO();
    }

    @Bean
    @DatabaseType("REDIS")
    public UserDao redisDao(){
        return new RedisUserDAO();
    }
}